﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Eg.Core;

namespace NHCookbookMVC.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            return View();
        }

        public ActionResult About()
        {
            return View();
        }

        // test code
        public ActionResult Test()
        {
            // var productId = new Guid(Request["id"]);
            Product product;
            var session = MvcApplication.SessionFactory.GetCurrentSession();
            using (var transaction = session.BeginTransaction()) {
                // product = session.Get<Product>(productId);
                transaction.Commit();
            }
            return View();
        }

    }
}
